#include <QStringList>
#include "aed_sound.h"

AED_Sound::AED_Sound():m_path("NONAME"),m_name("NONAME")
{
}

AED_Sound::AED_Sound(const AED_Sound& script){
    m_path = script.m_path;
    m_name = script.m_name;
}

AED_Sound& AED_Sound::operator=(const AED_Sound& sound){
    m_path = sound.m_path;
    m_name = sound.m_name;

    return *this;
}

void AED_Sound::Load(const QString path){
    m_path = path;
    QStringList split = m_path.split("/");
    m_name = split.back();
}

QString AED_Sound::GetPath(){
    return m_path;
}

void AED_Sound::SetPath(const QString &path){
    m_path = path;
}

QString AED_Sound::GetName(){
    return m_name;
}


void AED_Sound::Save(QDomDocument &doc, QDomElement &header){
    QDomElement elem = doc.createElement("sound");
    elem.setAttribute("path",m_path);
    elem.setAttribute("name",m_name);
    header.appendChild(elem);
}
